package demo.set;

import java.util.TreeSet;

public class MyTreeSet {
   public static void main(String[] args) {
	TreeSet treeSet=new TreeSet(new AgeComparator());
	//Integer
	/*
	 * treeSet.add(11); // 11.compareTo("vaibhav");
	treeSet.add("vaibhav");  //ClassCastException 
	*/
	/*treeSet.add(5);  ///5.compareTo(85)  -1;
	treeSet.add(85);
	treeSet.add(3);
	treeSet.add(34);
*/
	//naemCompar.compare(t1,t2);
	treeSet.add(new Test(12,"A",12));
	treeSet.add(new Test(13,"W",50));
	treeSet.add(new Test(51,"X",47));
	treeSet.add(new Test(1,"B",10));
	treeSet.add(new Test(12,"D",5));
	
	
	System.out.println(treeSet);
	
	
	
}
}
